import request from '@/utils/request'
//从用户列表获取角色
export function getRoles (params) {
  return request({
    url: '/role/getRoles',
    method: 'get',
    params
  })
}
//从角色列表获取角色
export function getRoleList (data) {
  return request({
    url: '/role/list',
    method: 'post',
    data
  })
}
//新增角色
export function addRole (data) {
  return request({
    url: '/role/addRole',
    method: 'post',
    data
  })
}
//更新角色
export function updateRole (data) {
  return request({
    url: '/role/updateRole',
    method: 'post',
    data
  })
}

export function deleteRoleById (id) {
  return request({
    url: '/role/deleteById',
    method: 'get',
    params: { id }
  })
}

export function queryRoleByCode (params) {
  return request({
    url: '/role/checkCode',
    method: 'get',
    params
  })
}